package top.whysu.study.thinkinjava.chapter8.polymorphism.example3;

public class Sub extends Super{
    public int field = 1;
    @Override
    public int getField(){return field;}
    public int getSuperField(){return super.field;}

    public static void main(String[] args) {
        Super sup = new Sub();
        // 打印0,1
        System.out.println(sup.field + "," + sup.getField());

        Sub sub = new Sub();
        // 打印1,1,0
        System.out.println(sub.field + "," + sub.getField() + "," + sub.getSuperField());
    }
}